Skip to content

Create core project with non-jvm-only dependencies#35

Open
johnynek wants to merge 6 commits intouuverifiers:masterfrom
johnynek:oscar/core-extract-minimal
Open

Create core project with non-jvm-only dependencies#35
johnynek wants to merge 6 commits intouuverifiers:masterfrom
johnynek:oscar/core-extract-minimal

Conversation

@johnynek
Copy link

I would like to be able to run princess on scalajs (see issue #34 ).

This PR attempts to move all non-JVM code into a core package, leaving the current APIs that require the JVM in the src directory.

I don't think this is ready to merge, but it is here to see if you are open to a refactor along these lines.

comp

} else {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously this changes semantics, but if we were to pursue this we could implement a version of this file for the JVM and one for scala JS and implement the intent correctly.

class CounterState {

private val counters = new ConcurrentHashMap[Counter, LongAdder]
private val counters = new MHashMap[Counter, Long] {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously this isn't safe in a threaded environment, but if the approach is interesting to you we could implement a jvm version of this file and js version of this file and select the correct one at build time.

@pruemmer
Copy link
Collaborator

This looks like a reasonable approach! Two thoughts:

  • There are some dependencies of theory solvers on the SMT-LIB parser AST, though the interface SMTParseableTheory. This probably means that the actual AST has to be include in the core project.
  • The main place where threads are used is the SimpleAPI. It would be possible (probably) to refactor this class to have multiple back-ends, both single-threaded and multi-threaded ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants